﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Manager_Pwd.aspx.cs" Inherits="fsw.Web.Manager.Manager_Pwd" ValidateRequest="false" %>
<%@ Register Src="~/HeaderJs.ascx" TagPrefix="uc1" TagName="HeaderJs" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit" />
    <title>密码修改</title>
    <uc1:HeaderJs runat="server" ID="HeaderJs" />
</head>
<body>
    <div class="position">当前位置：<a href="manager_pwd.asp">修改密码</a></div>
    <div class="border">
        <legend>修改密码</legend>
        <form class="am-form am-form-horizontal" method="post">
            <div class="am-form-group">
                <label class="am-u-sm-2 am-form-label">用户名</label>
                <div class="am-u-sm-10">
                    <input type="text" name="t0" size="30" value="<% =model_admin.UserName%>" disabled>
                </div>
            </div>
            <div class="am-form-group">
                <label class="am-u-sm-2 am-form-label">原密码</label>
                <div class="am-u-sm-10">
                    <input type="password" name="t0" size="30" maxlength="16" data-rule="原密码:required;password;">
                </div>
            </div>
            <div class="am-form-group">
                <label class="am-u-sm-2 am-form-label">新密码</label>
                <div class="am-u-sm-10">
                    <input type="password" name="t1" size="30" maxlength="16" data-rule="新密码:required;password;">
                </div>
            </div>
            <div class="am-form-group">
                <label class="am-u-sm-2 am-form-label">确认新密码</label>
                <div class="am-u-sm-10">
                    <input type="password" name="t2" size="30" maxlength="16" data-rule="确认新密码:required;password;match(t1)">
                </div>
            </div>
            <div class="am-form-group">
                <div class="am-u-sm-10 am-u-sm-offset-2">
                    <button type="submit" class="am-btn am-btn-primary am-radius">保存</button>
                    <button type="button" class="am-btn am-radius am-back">返回</button>
                </div>
            </div>
        </form>
    </div>
    <script>
        $(function () {
            toastr.options = { "positionClass": "toast-bottom-center", "timeOut": "3000", "onclick": null, showMethod: "slideDown", hideMethod: "slideUp" };
            $('.am-form').validator({
                timely: 2,
                stopOnError: true,
                focusCleanup: true,
                ignore: ':hidden',
                theme: 'yellow_right_effect',
                valid: function (form) {
                    $.AMUI.progress.inc();
                    $.ajax({
                        type: 'post',
                        cache: false,
                        dataType: 'json',
                        url: 'Manager_Pwd.aspx',
                        data: $(form).serialize(),
                        error: function (e) { alert(e.responseText); },
                        success: function (d) {
                            $.AMUI.progress.set(1.0);
                            if (d.state == 'success') {
                                toastr.success(d.msg);
                                setTimeout(function () { location.href = '/Right.aspx'; }, 1500);
                            }
                            else {
                                toastr.error(d.msg);
                            }

                        }
                    })
                }
            });
        })
</script>
</body>
</html>
